package com.falm.maker.meta;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author Administrator
 */
@NoArgsConstructor
@Data
public class Meta {

    @JsonProperty("name")
    private String name;
    @JsonProperty("description")
    private String description;
    @JsonProperty("basePackage")
    private String basePackage;
    @JsonProperty("version")
    private String version;
    @JsonProperty("author")
    private String author;
    @JsonProperty("createTime")
    private String createTime;
    @JsonProperty("fileConfig")
    private FileConfigDTO fileConfig;
    @JsonProperty("modelConfig")
    private ModelConfigDTO modelConfig;

    @NoArgsConstructor
    @Data
    public static class FileConfigDTO {
        @JsonProperty("inputRootPath")
        private String inputRootPath;
        @JsonProperty("outputRootPath")
        private String outputRootPath;
        @JsonProperty("type")
        private String type;
        @JsonProperty("files")
        private List<FileInfo> files;

        @NoArgsConstructor
        @Data
        public static class FileInfo {
            @JsonProperty("inputPath")
            private String inputPath;
            @JsonProperty("outputPath")
            private String outputPath;
            @JsonProperty("type")
            private String type;
            @JsonProperty("generateType")
            private String generateType;
            @JsonProperty("beanType")
            private String beanType;
        }
    }

    @NoArgsConstructor
    @Data
    public static class ModelConfigDTO {
        @JsonProperty("models")
        private List<ModelInfo> models;

        @NoArgsConstructor
        @Data
        public static class ModelInfo {
            @JsonProperty("fieldName")
            private String fieldName;
            @JsonProperty("type")
            private String type;
            @JsonProperty("description")
            private String description;
            @JsonProperty("defaultValue")
            private Object defaultValue;
            @JsonProperty("abbr")
            private String abbr;
        }
    }
}
